Read at most size bytes from the file (less if the read hits EOF before obtaining size bytes). If the size argument is negative or omitted, read all data until ...
The readline() method doesn't trigger the end-of-file condition. Instead, when data is exhausted, it returns an empty string. fp = open(input) while ...